﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FactoryPattern
{
    internal class ProgramFactory
    {
        private static void Main(string[] args)
        {
            EnemyShipFactory shipFactory = new EnemyShipFactory();
            EnemyShip theEnemy = null;

            Console.WriteLine("What type of ship? (U / R / B)");
            string str = Console.ReadLine().Trim().ToUpper();

            if (str.Equals("U") || str.Equals("R") || str.Equals("B"))
            {
                theEnemy = shipFactory.makeEnemyShip(str.Trim());
                if (theEnemy != null)
                {
                    doStuffEnemy(theEnemy);
                }
            }
            else Console.WriteLine("Please enter U, R, or B next time");
        }

        public static void doStuffEnemy(EnemyShip anEnemyShip)
        {
            anEnemyShip.displayEnemyShip();
            anEnemyShip.followHeroShip();
            anEnemyShip.enemyShipShoots();
        }
    }
}
